# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: Florian Dejonckheere <florian@floriandejonckheere.be>
# Contributor: gori

pkgname=ipmitool
pkgver=1.8.19
pkgrel=3
pkgdesc="Command-line interface to IPMI-enabled devices"
arch=('loong64' 'x86_64')
url="https://github.com/ipmitool/ipmitool"
depends=('openssl')
license=('BSD')
source=("https://github.com/ipmitool/ipmitool/archive/refs/tags/IPMITOOL_${pkgver//./_}.tar.gz"
       )
sha256sums=('48b010e7bcdf93e4e4b6e43c53c7f60aa6873d574cbd45a8d86fa7aaeebaff9c')

_srcdir_name="ipmitool-IPMITOOL_${pkgver//./_}"

build(){
	cd "${srcdir}/${_srcdir_name}"

	./bootstrap
	./configure --prefix=/usr --sbindir=/usr/bin --with-kerneldir
	make
}

package(){
	cd "${srcdir}/${_srcdir_name}"

	make DESTDIR="${pkgdir}" install

	# Install license
	install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	curl https://www.iana.org/assignments/enterprise-numbers.txt > $pkgdir/usr/share/misc/enterprise-numbers
}
